package remoteRMI;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * @author: Alexander Martyushov
 */
public class MyRemoteImpl extends UnicastRemoteObject implements MyRemote {

    public MyRemoteImpl() throws RemoteException, MalformedURLException {}


    public String sayHello() throws RemoteException {
        return "Server says, Hello";
    }

    public static void main (String[] args){
    try {
        MyRemote service = new MyRemoteImpl();
        Naming.rebind("HelloRemote", service);
    } catch(Exception e){
        e.printStackTrace();
    }
    }
}
